<!--#include file="../Common/Config.asp"-->
<!--#include file="../Common/Function.asp"-->
<!--#include file="../Common/HO_Log.asp"-->
<!--#include file="../Common/EasyIDE.asp"-->
<!--#include file="../Common/HO_Label.asp"-->
<!--#include file="../Common/HotTemplate.asp"-->
<!--#include file="../Common/Cache.asp"-->

<%
	OpenDB
	Dim PageTemplateDir
	Dim PageContent
	Dim Conn
	
	PageTemplateDir =  "/HTMLTemplates/Template1/News/Index.html" 
	
	Set Conn = gConn
 	
	PageContent = Label_ReplaceAllNewsLabelsFromFile(PageTemplateDir)
 	
	CloseDB
 
	Response.Write(PageContent)
	
	
	
	Function Label_ReplaceAllNewsLabels(ByVal T)
 
		Label_ReplaceAllNewsLabels = T	
 
	End Function
	Function Label_ReplaceAllNewsLabelsFromFile(ByVal FilePath)
		Dim tp
		
		Dim ColumnID
		Dim rs 
		Dim sql
		Dim label
		Dim i,j
	 
		Dim pager 
		
		Set tp = new hotTemplate
		tp.loadfile FilePath
		tp.Content = Label_ReplaceAllUserLabels(tp.Content)
		tp.Content = Label_ReplaceAllSystemLabels(tp.Content)
		
		ColumnID = GetColumnID()
		Sql = "SELECT NewsTitle, Newshits,  Newsdateandtime AS NewsDateTime, Newsid " _
		& " FROM HO_News  where  ColumnID=" & ColumnID & " And NewsFlag=1 Order by newsindexorder asc,Newsid desc"
		
	 
		pager = pageturner_handle(Sql,"NewsID",gPageSize)
		Set rs = pager(0) 
		Dim rowNum
		rowNum = rs.Recordcount
		tp.set_block "newslist"
		j = 0
		If Not (rs.Eof) Then
			Do until rs.eof 
				j = j + 1
				For i = 0 to rs.Fields.Count - 1
					tp.set_bvar rs.Fields(i).name,rs(i)
					 
				Next
 
				tp.prase_block(rowNum-j )
				rs.MoveNext
			Loop
			
		End If
 
 		tp.set_var "PAGELIST", pageturner_show_block(pager(1),pager(2),pager(3),gPageSize,5)
		
		tp.prase_file()
		Closers(rs)
		Label_ReplaceAllNewsLabelsFromFile = tp.Content 
	End Function
	
%>